import React, { useDebugValue, useState } from 'react';

// 定义以Hooks,获取用户的在线状态
const useFriendStatus = (id) => {
  const [isOnline, setIsOnline] = useState(() => id ? true : false);
  useDebugValue(isOnline ? "ONLINE" : "OFFLINE");
  return isOnline;
}

const UseDebugValueView = () => {
  const inonline = useFriendStatus(234);


  return (
    <div>
      你的好友 {(inonline ? "ONLINE" : "OFFLINE")}
    </div>
  );
}

export default UseDebugValueView;
